﻿using System;
using System.IO;
using System.Reflection;

namespace Samurai.Infrastructure
{
    public class Logger
    {
        private static Logger _instance;
        public static Logger Instance
        {
            get
            {
                if (_instance == null)
                    _instance = new Logger();
                return _instance;
            }
        }

        private const string LogFileName = @"log.txt";

        private Logger()
        {
            
        }

        public void Write(string message)
        {
            var timedMessage = string.Format("At {0}, {1}", DateTime.Now, message);

            using (var file = new StreamWriter(LogFileName, true))
            {
                file.WriteLine(timedMessage);
            }
        }
    }
}